<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/6/21
 * Time: 10:23
 */

namespace app\common;


class Code
{
    const NONE = 0;
    const PARAM_ERROR = 1000;
    const VALID_ERROR = 1001;
    const EXISTS = 1002;
    const PHONE_EXISTS = 1003;
    const NAME_EXISTS = 1004;
    const FAIL = 1005;
    const PIC_CAPTURE_ERROR = 1006;
    const REFUSE_REASON = 1007;
    const APPROVE = 1008;
    const FAILED_AUDIT = 1009;
    const UPLOAD_FAILED = 1010;
    const NO_LOGIN = 1011;
    const POWER_REFUSE = 1012;
    const GOODS_NOT_EXISTS = 1013;
    const GOODS_STOCK_EMPTY = 1014;
    const SELECT_AREA = 1015;
    const EXAMINING = 1016;
    const ADDRESS_ERROR = 1017;
    const ZITIDIAN_ERROR = 1018;
    const ZHIFU = 1019;
    const EMPTY_CART = 1020;
    const YU_E_BUZU = 1021;
    const BRAND_EXISTS = 1022;
    const ORDER_EMPTY = 1023;
    const ERROR = 1024;
    const SUCCESS = 1025;
    const PASS_ERROR = 1026;
    const NAME_ERROR = 1027;
    const TO_AUTH_BIND = 1028;
    const CART_LIMIT = 1029;
    const NOT_FOUND = 1030;
    const COMMUNITY_NOT_FOUND = 1031;
    const YI_SHOU_CANG = 1032;
    const YUE_PWD_ERROR = 1033;
    const FREQUENTLY = 1034;
    const NO_QUERENSHOUHUO = 1035;
    const NO_SELLER = 1036;
    const ORDER_YIJIEDAN = 1037;
    static $msg = [
        self::NONE => "提交成功",
        self::PARAM_ERROR => "参数错误",
        self::VALID_ERROR => "验证失败",
        self::EXISTS => "记录已存在",
        self::PHONE_EXISTS => "电话已存在",
        self::NAME_EXISTS => "名字已存在",
        self::FAIL => "操作失败",
        self::REFUSE_REASON => "未填写拒绝原因",
        self::PIC_CAPTURE_ERROR => "验证码错误",
        self::APPROVE => "审核通过",
        self::FAILED_AUDIT => "审核未通过",
        self::UPLOAD_FAILED => "文件上传失败",
        self::NO_LOGIN => "请登录",
        self::POWER_REFUSE => "非法操作",
        self::GOODS_NOT_EXISTS => "商品已下架",
        self::GOODS_STOCK_EMPTY => "商品已售罄",
        self::SELECT_AREA => "选择区域",
        self::EXAMINING => "审核中",
        self::ADDRESS_ERROR => "地址信息不正确",
        self::ZITIDIAN_ERROR => "自提点信息不正确",
        self::ZHIFU => "前往支付",
        self::EMPTY_CART => "购物车是空的",
        self::YU_E_BUZU => "余额不足",
        self::BRAND_EXISTS => "此分类下的品牌已存在",
        self::ORDER_EMPTY => "您还没有订单",
        self::ERROR => "失败",
        self::SUCCESS => "成功",
        self::PASS_ERROR => "账号或密码错误",
        self::NAME_ERROR => "账号不存在",
        self::TO_AUTH_BIND => "请跳转至绑定手机页",
        self::NOT_FOUND => "不存在",
        self::COMMUNITY_NOT_FOUND => "请选择社区",
        self::YI_SHOU_CANG => "已收藏",
        self::YUE_PWD_ERROR => "支付密码错误",
        self::FREQUENTLY => "操作频繁",
        self::NO_QUERENSHOUHUO => "没有确认收货",
        self::NO_SELLER => "您不是商家",
        self::ORDER_YIJIEDAN => "商家已接单",

    ];

    public static function msg($type)
    {
        if (!isset(self::$msg[$type])) {
            return "未知错误";
        } else {
            return self::$msg[$type];
        }
    }
}